package com.ruoyi.web.controller.tool;

import com.spire.pdf.*;
import java.io.*;
public class mergePDFbyStream {
    public static void main(String[] args) throws Exception {

        FileInputStream stream1 = new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\tets\\盖章\\06-保密责任书--盖章、骑缝章.pdf"));
        FileInputStream stream2 = new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\tets\\盖章\\07-安全施工承诺书--盖章.pdf"));
        FileInputStream stream3 = new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\tets\\盖章\\08-施工组织设计方案报审表及施工组织计划--盖章、骑缝章.pdf"));
        FileInputStream stream4 = new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\tets\\盖章\\09-总体施工计划表报审表--盖章、骑缝章--盖章、骑缝章.pdf"));
        FileInputStream stream5 = new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\tets\\盖章\\10开工报审表及人员资质--盖章、骑缝章.pdf"));
        FileInputStream stream6 = new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\tets\\盖章\\13-变更调整申请\\MergedPDF.pdf"));
        FileInputStream stream7 = new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\tets\\盖章\\15-设备报审表-4份\\MergedPDF.pdf"));
        FileInputStream stream8 = new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\tets\\盖章\\16-设备进场查验表-6份\\MergedPDF.pdf"));
        FileInputStream stream9 = new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\tets\\盖章\\17-设备开箱检查表-37份，每份盖章、骑缝章.pdf"));




        InputStream[] streams = new FileInputStream[]{stream3,stream4};
        //Merge these documents and return an object of PdfDocumentBase
        PdfDocumentBase pdf = PdfDocument.mergeFiles(streams);
        //Save the result to a PDF file
        pdf.save("C:\\Users\\Administrator\\Desktop\\tets\\盖章\\MergedPDF1.pdf", FileFormat.PDF);
    }
}